﻿<%@ Page Title="Quản lí trình độ chuyên môn" Language="C#" MasterPageFile="~/Views/MasterPageViews.master"
    AutoEventWireup="true" CodeFile="Qualifications.aspx.cs"
    Inherits="Views_Qualifications" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<asp:Content ID="ContentHeader" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="ContentChange" ContentPlaceHolderID="ContentPlaceHolderChange" runat="Server">
    <h3 class="header-title">
        <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="lblHeader" runat="server" Text="Quản lí trình độ chuyên môn"
            Icon="ApplicationOsxCascade" />
    </h3>

    <div class="content-sub">
        <ext:Toolbar ID="ToolbarFunctions" runat="server">
            <Items>
                <ext:Button ID="btnToobarAdd" runat="server" Text="Thêm mới" Icon="Add" OnDirectClick="btnToobarAdd_DirectClick" />
                <ext:Button ID="btnToobarUpdate" runat="server" Text="Chỉnh sửa" Icon="Pencil" OnDirectClick="btnToobarUpdate_DirectClick" />
                <ext:Button ID="btnToobarDelete" runat="server" Text="Xóa" Icon="Delete" OnDirectClick="btnToobarDelete_DirectClick" />
                <ext:Button ID="btnToobarHelp" runat="server" Text="Hỗ trợ" Icon="Help" />
            </Items>
        </ext:Toolbar>


        <!--Store find data-->
        <ext:Store
            ID="StoreQuas"
            runat="server"
            OnReadData="StoreQuas_ReadData"
            PageSize="10">
            <Model>
                <ext:Model ID="ModelQuas" runat="server" IDProperty="QuaID">
                    <Fields>
                        <ext:ModelField Name="QuaID" />
                        <ext:ModelField Name="CodeOfQua" />
                        <ext:ModelField Name="NameOfQua" />
                        <ext:ModelField Name="Descriptons" />
                        <ext:ModelField Name="StatusOfQua" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>

        <!--Content data-->
        <ext:GridPanel
            ID="gridPanelQuas"
            runat="server"
            StoreID="StoreQuas"
            Height="300"
            Title="Danh sách trình độ chuyên môn">
            <ColumnModel ID="ColumnModelQuas" runat="server">
                <Columns>
                    <ext:Column ID="Col_QuaID" runat="server" Text="ID" DataIndex="QuaID" />
                    <ext:Column ID="Col_CodeOfQua" runat="server" Text="Mã" DataIndex="CodeOfQua" />
                    <ext:Column ID="Col_NameOfQua" runat="server" Text="Tên trình độ" DataIndex="NameOfQua" Flex="1" />
                    <ext:Column ID="Col_Descriptons" runat="server" Text="Mô tả" DataIndex="Descriptons" />
                    <ext:CheckColumn ID="Col_StatusOfQua" runat="server" Text="Trạng thái" DataIndex="StatusOfQua" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModelQuas" runat="server" Mode="Single">
                    <DirectEvents>
                        <Select OnEvent="RowSelected" Buffer="250" />
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbarQuas" runat="server" StoreID="StoreQuas" AfterPageText="của {0}"
                    BeforePageText="Trang" DisplayMsg="Hiển thị bản ghi {0} - {1} của {2}"
                    EmptyMsg="Chưa có dữ liệu" FirstText="Trang đầu tiên" LastText="Trang cuối cùng" NextText="Trang kế tiếp"
                    PrevText="Trang trước"
                    RefreshText="Làm mới" />
            </BottomBar>
        </ext:GridPanel>
    </div>
    <!-- Cửa sổ popup thêm trình độ chuyên môn -->
    <ext:Window
        ID="windowAddQuas"
        runat="server"
        Title="Thêm mới trình độ chuyên môn"
        Icon="Add"
        Height="300"
        Width="350"
        BodyStyle="background-color: #fff;"
        Modal="true"
        ShadowMode="Drop"
        Hidden="true">
        <Content>
            <ext:Toolbar ID="ToolbarAddQuas" runat="server">
                <Items>
                    <ext:Button ID="btnAdd" runat="server" Text="Thêm mới" Icon="Disk" OnDirectClick="btnAdd_DirectClick" />
                    <ext:Button ID="btnAddCancel" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnAddCancel_DirectClick" />
                </Items>
            </ext:Toolbar>
            <div class="content-popup-style">
                <div class="view-msg-popup">
                    <ext:Label ID="lblFormAddMsg" runat="server" StyleHtmlContent="True" Icon="None" Cls="lable-message-error" />
                </div>
                <div>
                    <ext:TextField ID="txtFormAddCode" runat="server" FieldLabel="Mã" Width="310" MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormAddName" runat="server" FieldLabel="Tên trình độ" Width="310" MarginSpec="5 0 5 0" />
                    <ext:TextArea ID="txtFormAddDes" runat="server" FieldLabel="Mô tả" Width="310" MarginSpec="5 0 5 0" />
                    <ext:Checkbox ID="chkFormAddStatus" runat="server" FieldLabel="Trạng thái" BoxLabel="Cho phép hoạt động" />
                </div>
            </div>
        </Content>
    </ext:Window>
    <!-- Cửa sổ popup cập nhật trình độ chuyên môn -->
    <ext:Window
        ID="windowUpdateQuas"
        runat="server"
        Title="Cập nhật trình độ chuyên môn"
        Icon="Add"
        Height="300"
        Width="350"
        BodyStyle="background-color: #fff;"
        Modal="true"
        ShadowMode="Drop"
        Hidden="true">
        <Content>
            <ext:Toolbar ID="ToolbarUpdateQuas" runat="server">
                <Items>
                    <ext:Button ID="btnUpdate" runat="server" Text="Cập nhật" Icon="Disk" OnDirectClick="btnUpdate_DirectClick" />
                    <ext:Button ID="btnCancelUpdate" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnCancelUpdate_DirectClick" />
                </Items>
            </ext:Toolbar>
            <div class="content-popup-style">
                <div class="view-msg-popup">
                    <ext:Label ID="lblFormUpdateMsg" runat="server" StyleHtmlContent="True" Icon="None" Cls="lable-message-error" />
                </div>
                <div>
                    <ext:TextField ID="txtFormUpdateCode" runat="server" FieldLabel="Mã" Width="310" Height="25" MarginSpec="5 0 5 0" />
                    <ext:TextField ID="txtFormUpdateName" runat="server" FieldLabel="Tên trình độ" Width="310" Height="25"
                        MarginSpec="5 0 5 0" />
                    <ext:TextArea ID="txtFormUpdateDes" runat="server" FieldLabel="Mô tả" Width="310" MarginSpec="5 0 5 0" />
                    <ext:Checkbox ID="chkFormUpdateStatus" runat="server" FieldLabel="Trạng thái" BoxLabel="Cho phép hoạt động" />
                </div>
            </div>
        </Content>
    </ext:Window>
    <!-- Gird-View Scripts -->
    <script>
        var template = '<span style="color:{0};">{1}</span>';

        var change = function (value) {
            return Ext.String.format(template, (value > 0) ? "green" : "red", value);
        }

        var pctChange = function (value) {
            return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
        }
    </script>

    <!-- Hiển thị thông tin chi tiết -->
    <div class="view-info-record">
        <h3 class="header-title">
            <ext:Label ID="lblHeaderViewInfomations" StyleHtmlCls="lable-message" StyleHtmlContent="true" runat="server"
                Text="Hiển thị thông tin"
                Icon="Information" />
        </h3>
        <div class="content-info">
            <table>
                <tr>
                    <td class="with-td-view-info">ID:</td>
                    <td>
                        <ext:Label ID="lblViewID" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Mã trình độ:</td>
                    <td>
                        <ext:Label ID="lblViewCode" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Tên trình độ:</td>
                    <td>
                        <ext:Label ID="lblViewName" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Mô tả:</td>
                    <td>
                        <ext:Label ID="lblViewDesc" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Trạng thái:</td>
                    <td>
                        <ext:Checkbox ID="chkViewStatus" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>